<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .cards {
          width: 800px;
          display: flex;
          /* 固定间距 */
          /* gap: 1rem; */
        }
        .card {
          height: 30px;
          background-color: pink;
          /* 可以伸缩的尺寸 */
          /* grow shrink basis */
          /* flex-shrink是1表示可以被挤压 */
          /* flex-grow是0,即使有剩余空间也不会去瓜分； */
          /* https://juejin.cn/post/6844904016439148551?searchId=202401240924338BCA0569A2BF91C930C9 */
          flex: 1 1 calc(100% / 4 - 10px);
        }
    </style>
</head>
<body>
    <div class="cards">
        <div class="card">1</div>
        <div class="card">2</div>
        <div class="card">3</div>
        <div class="card">4</div>
    </div>    
</body>
</html>